package com.zkthink.ceres.member.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @Author Xiaoyan
 * @create 2021/12/14 17:24
 */
@Getter
public enum GiftLocationSourceEnum {
    SUN("sun", "晒晒"),
    MSG("msg", "消息"),
    VIDEO("video", "视频"),
    LOVEDICTIONARY("loveDictionary", "恋爱宝典"),
    ADMIN("admin", "系统"),
    LIVE("live", "直播"),
    ;

    private String code;

    private String desc;

    GiftLocationSourceEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GiftLocationSourceEnum getDscByType(String type) {
        for (GiftLocationSourceEnum p : values()) {
            if (p.getCode().equals(type)) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
